package main

import "fmt"

type TreeNode struct {
	Val         int
	Left, Right *TreeNode
}

func maxDepth(root *TreeNode) int {
	if root == nil {
		return 0
	}
	leftH := maxDepth(root.Left) + 1
	rightH := maxDepth(root.Right) + 1
	if leftH > rightH {
		return leftH
	} else {
		return rightH
	}
}

func main() {
	var a, b TreeNode
	a.Right = &b
	fmt.Println(a)
	fmt.Println(maxDepth(&a))
}
